<%@page import="java.util.TreeMap"%>
<%@page import="helpers.StringHelper"%>
<%@page import="java.util.Map"%>
<%@page import="entities.MetaSeo"%>
<%@page import="systems.ConfigSystem"%>
<%@page import="entities.SiteConfig"%>
<%@page import="helpers.UrlHelper"%>
<%
SiteConfig siteConfig = ConfigSystem.getConfigs();
String name = (String) request.getAttribute("name");

MetaSeo metaseo = (MetaSeo) request.getAttribute("metaseo");

//Set content for Seo
Map<String, String> replates = new TreeMap<String, String>();
replates.put("__SERVER_NAME__", UrlHelper.getDomainServer(request));
replates.put("__SERVER_URL__", UrlHelper.getServerUrl(request));
replates.put("__KEYWORD__", name);

String title = StringHelper.replateContent(metaseo.getTitle(), replates);
String description = StringHelper.replateContent(metaseo.getDescription(), replates);
String keywords = StringHelper.replateContent(metaseo.getKeywords(), replates);
String url = StringHelper.replateContent(metaseo.getOgurl(), replates);
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/templates/ezsarticle/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="keywords" value="<%=keywords %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>
		<div class="row-fluid">
			<div class="span8">
				<div class="block">
					<h3 class="title">Search Result for <%=name %></h3>
					<!-- search -->
					<div class="block-content">
						<form class="form-search" action="/search" id="searchform" method="get">
							<input type="text" class="input-medium" name="q" value="" placeholder="Enter Content">
							<input type="submit" class="btn btn-success" value="Search" >
						</form>
					</div>
					<script type="text/javascript" src="//www.google.com/jsapi"></script>	
					<script type="text/javascript">
						google.load('search', '1');
						google.setOnLoadCallback(function() {
							google.search.CustomSearchControl.attachAutoCompletionWithOptions(
									'013315504628135767172:d6shbtxu-uo+qptype:1', document
											.getElementById('cse-main-search-text'),
									'cse-main-search-box', {
										'styleOptions' : {
											'widthOffset' : 150
										}
									});
						});
					</script>
					<div id="cse-search-results"></div>
					<script type="text/javascript">
					  var googleSearchIframeName = "cse-search-results";
					  var googleSearchFormName = "cse-search-box";
					  var googleSearchDomain = "www.google.com";
					  var googleSearchPath = "/cse";
					  var googleSearchFrameHeight = 1300;
					  var googleSearchResizeIframe = true;
					</script>
					<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>

					<!-- end search -->
				</div>
			</div>
			
			<jsp:include page="/templates/ezsarticle/elements/right.jsp" />
			
		</div>

<jsp:include page="/templates/ezsarticle/layouts/footer.jsp" />